package cn.tianyigps.m7.beans;

import lombok.Getter;
import lombok.Setter;
import org.bson.Document;

import java.util.List;


/**
 * Created with IDEA
 *
 * @description: 设备接口，所有设备实体均需实现它
 * @author: cui.guibin
 * @create: 2019/3/7 9:58
 **/
@Setter
@Getter
public abstract class Equipment {

    private String equipmentId;
    private String type;

    public Equipment() {
        super();
    }
    public Equipment(String equipmentId,String type) {
        this.equipmentId = equipmentId;
        this.type = type;
    }
    /**
     * @param: data
     * @return boolean
     * @author cui.guibin
     * @date 2019/3/7 10:01
     * 校验是否是错误包
     */
   public abstract boolean checkData(String data);
    /**
     * @param: data
     * @return StandardModel
     * @author cui.guibin
     * @date 2019/3/7 10:05
     * 解析数据包种类 然后调用各种包解析方法
     */
    public abstract List<Document> analysisPackageType(String strData);

    /**
     * @param: data
     * @return String
     * @author cui.guibin
     * @date 2019/3/7 10:06
     *  确认指令
     */
    public abstract byte[] response(String data);
    /**
     * @param: data
     * @return String
     * @author cui.guibin
     * @date 2019/3/7 10:06
     *  通用确认指令
     */
    public abstract byte[] generalResponse(String data);
    /**
     * @param: data
     * @return String
     * @author cui.guibin
     * @date 2019/3/7 10:06
     *  下发指令
     */
    public abstract byte[] command(String data);


}
